home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / dev / c / libiconv_src.lha / autoconf / config.sub < prev    next >
Encoding:
Text File  |  2000-11-07  |  24.9 KB  |  1,269 lines

  1. #! /bin/sh
  2. # Configuration validation subroutine script, version 1.1.
  3. #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
  4. #   Free Software Foundation, Inc.
  5. #
  6. # This file is (in principle) common to ALL GNU software.
  7. # The presence of a machine in this file suggests that SOME GNU software
  8. # can handle that machine.  It does not imply ALL GNU software can.
  9. #
  10. # This file is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 2 of the License, or
  13. # (at your option) any later version.
  14. #
  15. # This program is distributed in the hope that it will be useful,
  16. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with this program; if not, write to the Free Software
  22. # Foundation, Inc., 59 Temple Place - Suite 330,
  23. # Boston, MA 02111-1307, USA.
  24.  
  25. # As a special exception to the GNU General Public License, if you
  26. # distribute this file as part of a program that contains a
  27. # configuration script generated by Autoconf, you may include it under
  28. # the same distribution terms that you use for the rest of that program.
  29.  
  30. # Written by Per Bothner <bothner@cygnus.com>.
  31. # Please send patches to <config-patches@gnu.org>.
  32. #
  33. # Changed by Bruno Haible, 25 March 2000.
  34. # The master version of this file is in
  35. # ftp://clisp.cons.org/pub/lisp/clisp/source/.
  36.  
  37. # Configuration subroutine to validate and canonicalize a configuration type.
  38. # Supply the specified configuration type as an argument.
  39. # If it is invalid, we print an error message on stderr and exit with code 1.
  40. # Otherwise, we print the canonical config type on stdout and succeed.
  41.  
  42. # This file is supposed to be the same for all GNU packages
  43. # and recognize all the CPU types, system types and aliases
  44. # that are meaningful with *any* GNU software.
  45. # Each package is responsible for reporting which valid configurations
  46. # it does not support.  The user should be able to distinguish
  47. # a failure to support a valid configuration from a meaningless
  48. # configuration.
  49.  
  50. # The goal of this file is to map all the various variations of a given
  51. # machine specification into a single specification in the form:
  52. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
  53. # or in some cases, the newer four-part form:
  54. #    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM-GNUSTUFF
  55. # It is wrong to echo any other type of specification.
  56.  
  57. if [ x$1 = x ]
  58. then
  59.     echo Configuration name missing. 1>&2
  60.     echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
  61.     echo "or     $0 ALIAS" 1>&2
  62.     echo where ALIAS is a recognized configuration type. 1>&2
  63.     exit 1
  64. fi
  65.  
  66. # First pass through any local machine types.
  67. case $1 in
  68.     *local*)
  69.         echo $1
  70.         exit 0
  71.         ;;
  72.     *)
  73.     ;;
  74. esac
  75.  
  76. # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
  77. # Here we must recognize all the valid KERNEL-OS combinations.
  78. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
  79. case $maybe_os in
  80.   nto-qnx* | linux-gnu*)
  81.     os=-$maybe_os
  82.     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
  83.     ;;
  84.   *)
  85.     basic_machine=`echo $1 | sed 's/-[^-]*$//'`
  86.     if [ $basic_machine != $1 ]
  87.     then os=`echo $1 | sed 's/.*-/-/'`
  88.     else os=; fi
  89.     ;;
  90. esac
  91.  
  92. ### Let's recognize common machines as not being operating systems so
  93. ### that things like config.sub decstation-3100 work.  We also
  94. ### recognize some manufacturers as not being operating systems, so we
  95. ### can provide default operating systems below.
  96. case $os in
  97.     -sun*os*)
  98.         # Prevent following clause from handling this invalid input.
  99.         ;;
  100.     -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  101.     -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  102.     -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
  103.     -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  104.     -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  105.     -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  106.     -apple)
  107.         os=
  108.         basic_machine=$1
  109.         ;;
  110.     -sim | -cisco | -oki | -wec | -winbond)
  111.         os=
  112.         basic_machine=$1
  113.         ;;
  114.     -scout)
  115.         ;;
  116.     -wrs)
  117.         os=-vxworks
  118.         basic_machine=$1
  119.         ;;
  120.     -hiux*)
  121.         os=-hiuxwe2
  122.         ;;
  123.     -sco5)
  124.         os=-sco3.2v5
  125.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  126.         ;;
  127.     -sco4)
  128.         os=-sco3.2v4
  129.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  130.         ;;
  131.     -sco3.2.[4-9]*)
  132.         os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
  133.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  134.         ;;
  135.     -sco3.2v[4-9]*)
  136.         # Don't forget version if it is 3.2v4 or newer.
  137.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  138.         ;;
  139.     -sco*)
  140.         os=-sco3.2v2
  141.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  142.         ;;
  143.     -udk*)
  144.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  145.         ;;
  146.     -isc)
  147.         os=-isc2.2
  148.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  149.         ;;
  150.     -clix*)
  151.         basic_machine=clipper-intergraph
  152.         ;;
  153.     -isc*)
  154.         basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
  155.         ;;
  156.     -lynx*)
  157.         os=-lynxos
  158.         ;;
  159.     -ptx*)
  160.         basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
  161.         ;;
  162.     -windowsnt*)
  163.         os=`echo $os | sed -e 's/windowsnt/winnt/'`
  164.         ;;
  165.     -psos*)
  166.         os=-psos
  167.         ;;
  168.     -mint | -mint[0-9]*)
  169.         basic_machine=m68k-atari
  170.         os=-mint
  171.         ;;
  172. esac
  173.  
  174. # Decode aliases for certain CPU-COMPANY combinations.
  175. case $basic_machine in
  176.     # Recognize the basic CPU types without company name.
  177.     # Some are omitted here because they have special meanings below.
  178.     tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
  179.         | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \
  180.         | 580 | i960 | h8300 \
  181.         | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \
  182.         | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
  183.         | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
  184.         | alphaev6[78] \
  185.         | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \
  186.         | 1750a | dsp16xx | pdp11 | s390 | mips16 | mips64 | mipsel | mips64el \
  187.         | mips64orion | mips64orionel | mipstx39 | mipstx39el \
  188.         | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
  189.         | mips64vr5000 | miprs64vr5000el | mcore \
  190.         | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
  191.         | thumb | d10v | fr30 | avr)
  192.         basic_machine=$basic_machine-unknown
  193.         ;;
  194.     m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl)
  195.         ;;
  196.     # We use `pc' rather than `unknown'
  197.     # because (1) that's what they normally are, and
  198.     # (2) the word "unknown" tends to confuse beginning users.
  199.     i[34567]86)
  200.       basic_machine=$basic_machine-pc
  201.       ;;
  202.     # Object if more than one company name word.
  203.     *-*-*)
  204.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  205.         exit 1
  206.         ;;
  207.     # Recognize the basic CPU types with company name.
  208.     # FIXME: clean up the formatting here.
  209.     vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
  210.           | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
  211.           | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
  212.           | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
  213.           | xmp-* | ymp-* \
  214.           | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \
  215.           | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \
  216.           | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
  217.           | alphaev6[78]-* \
  218.           | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
  219.           | clipper-* | orion-* \
  220.           | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
  221.           | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
  222.           | mips64el-* | mips64orion-* | mips64orionel-* \
  223.           | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
  224.           | mipstx39-* | mipstx39el-* | mcore-* \
  225.           | f301-* | armv*-* | s390-* | sv1-* | t3e-* \
  226.           | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
  227.           | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* )
  228.         ;;
  229.     # Recognize the various machine names and aliases which stand
  230.     # for a CPU type and a company and sometimes even an OS.
  231.     386bsd)
  232.         basic_machine=i386-unknown
  233.         os=-bsd
  234.         ;;
  235.     3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
  236.         basic_machine=m68000-att
  237.         ;;
  238.     3b*)
  239.         basic_machine=we32k-att
  240.         ;;
  241.     a29khif)
  242.         basic_machine=a29k-amd
  243.         os=-udi
  244.         ;;
  245.     adobe68k)
  246.         basic_machine=m68010-adobe
  247.         os=-scout
  248.         ;;
  249.     alliant | fx80)
  250.         basic_machine=fx80-alliant
  251.         ;;
  252.     altos | altos3068)
  253.         basic_machine=m68k-altos
  254.         ;;
  255.     am29k)
  256.         basic_machine=a29k-none
  257.         os=-bsd
  258.         ;;
  259.     amdahl)
  260.         basic_machine=580-amdahl
  261.         os=-sysv
  262.         ;;
  263.     amiga | amiga-*)
  264.         basic_machine=m68k-cbm
  265.         ;;
  266.     amigaos | amigados)
  267.         basic_machine=m68k-cbm
  268.         os=-amigaos
  269.         ;;
  270.     amigaunix | amix)
  271.         basic_machine=m68k-cbm
  272.         os=-sysv4
  273.         ;;
  274.     apollo68)
  275.         basic_machine=m68k-apollo
  276.         os=-sysv
  277.         ;;
  278.     apollo68bsd)
  279.         basic_machine=m68k-apollo
  280.         os=-bsd
  281.         ;;
  282.     aux)
  283.         basic_machine=m68k-apple
  284.         os=-aux
  285.         ;;
  286.     balance)
  287.         basic_machine=ns32k-sequent
  288.         os=-dynix
  289.         ;;
  290.     convex-c1)
  291.         basic_machine=c1-convex
  292.         os=-bsd
  293.         ;;
  294.     convex-c2)
  295.         basic_machine=c2-convex
  296.         os=-bsd
  297.         ;;
  298.     convex-c32)
  299.         basic_machine=c32-convex
  300.         os=-bsd
  301.         ;;
  302.     convex-c34)
  303.         basic_machine=c34-convex
  304.         os=-bsd
  305.         ;;
  306.     convex-c38)
  307.         basic_machine=c38-convex
  308.         os=-bsd
  309.         ;;
  310.     cray | ymp)
  311.         basic_machine=ymp-cray
  312.         os=-unicos
  313.         ;;
  314.     cray2)
  315.         basic_machine=cray2-cray
  316.         os=-unicos
  317.         ;;
  318.     [ctj]90-cray)
  319.         basic_machine=c90-cray
  320.         os=-unicos
  321.         ;;
  322.     crds | unos)
  323.         basic_machine=m68k-crds
  324.         ;;
  325.     da30 | da30-*)
  326.         basic_machine=m68k-da30
  327.         ;;
  328.     decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
  329.         basic_machine=mips-dec
  330.         ;;
  331.     delta | 3300 | motorola-3300 | motorola-delta \
  332.           | 3300-motorola | delta-motorola)
  333.         basic_machine=m68k-motorola
  334.         ;;
  335.     delta88)
  336.         basic_machine=m88k-motorola
  337.         os=-sysv3
  338.         ;;
  339.     dpx20 | dpx20-*)
  340.         basic_machine=rs6000-bull
  341.         os=-bosx
  342.         ;;
  343.     dpx2* | dpx2*-bull)
  344.         basic_machine=m68k-bull
  345.         os=-sysv3
  346.         ;;
  347.     ebmon29k)
  348.         basic_machine=a29k-amd
  349.         os=-ebmon
  350.         ;;
  351.     elxsi)
  352.         basic_machine=elxsi-elxsi
  353.         os=-bsd
  354.         ;;
  355.     encore | umax | mmax)
  356.         basic_machine=ns32k-encore
  357.         ;;
  358.     es1800 | OSE68k | ose68k | ose | OSE)
  359.         basic_machine=m68k-ericsson
  360.         os=-ose
  361.         ;;
  362.     fx2800)
  363.         basic_machine=i860-alliant
  364.         ;;
  365.     genix)
  366.         basic_machine=ns32k-ns
  367.         ;;
  368.     gmicro)
  369.         basic_machine=tron-gmicro
  370.         os=-sysv
  371.         ;;
  372.     h3050r* | hiux*)
  373.         basic_machine=hppa1.1-hitachi
  374.         os=-hiuxwe2
  375.         ;;
  376.     h8300hms)
  377.         basic_machine=h8300-hitachi
  378.         os=-hms
  379.         ;;
  380.     h8300xray)
  381.         basic_machine=h8300-hitachi
  382.         os=-xray
  383.         ;;
  384.     h8500hms)
  385.         basic_machine=h8500-hitachi
  386.         os=-hms
  387.         ;;
  388.     harris)
  389.         basic_machine=m88k-harris
  390.         os=-sysv3
  391.         ;;
  392.     hp300-*)
  393.         basic_machine=m68k-hp
  394.         ;;
  395.     hp300bsd)
  396.         basic_machine=m68k-hp
  397.         os=-bsd
  398.         ;;
  399.     hp300hpux)
  400.         basic_machine=m68k-hp
  401.         os=-hpux
  402.         ;;
  403.     hp3k9[0-9][0-9] | hp9[0-9][0-9])
  404.         basic_machine=hppa1.0-hp
  405.         ;;
  406.     hp9k2[0-9][0-9] | hp9k31[0-9])
  407.         basic_machine=m68000-hp
  408.         ;;
  409.     hp9k3[2-9][0-9] | hp9k4[0-9][0-9])
  410.         basic_machine=m68k-hp
  411.         ;;
  412.     hp9k6[0-9][0-9] | hp6[0-9][0-9])
  413.         basic_machine=hppa1.0-hp
  414.         ;;
  415.     hp9k78[0-9] | hp78[0-9] | hp9k80[24] | hp80[24] | hp9k8[67]1 | hp8[67]1 | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
  416.         basic_machine=hppa2.0-hp
  417.         ;;
  418.     hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9][13679] | hp8[0-9][13679] | hp9k892 | hp892)
  419.         basic_machine=hppa1.1-hp
  420.         ;;
  421.     hp9k8[0-9][0-9] | hp8[0-9][0-9])
  422.         basic_machine=hppa1.0-hp
  423.         ;;
  424.     hppa-next)
  425.         os=-nextstep3
  426.         ;;
  427.     hppaosf)
  428.         basic_machine=hppa1.1-hp
  429.         os=-osf
  430.         ;;
  431.     hppro)
  432.         basic_machine=hppa1.1-hp
  433.         os=-proelf
  434.         ;;
  435.     i370-ibm* | ibm*)
  436.         basic_machine=i370-ibm
  437.         ;;
  438. # I'm not sure what "Sysv32" means.  Should this be sysv3.2?
  439.     i[34567]86v32)
  440.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  441.         os=-sysv32
  442.         ;;
  443.     i[34567]86v4*)
  444.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  445.         os=-sysv4
  446.         ;;
  447.     i[34567]86v)
  448.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  449.         os=-sysv
  450.         ;;
  451.     i[34567]86sol2)
  452.         basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
  453.         os=-solaris2
  454.         ;;
  455.     i386mach)
  456.         basic_machine=i386-mach
  457.         os=-mach
  458.         ;;
  459.     i386-vsta | vsta)
  460.         basic_machine=i386-unknown
  461.         os=-vsta
  462.         ;;
  463.     i386-go32 | go32)
  464.         basic_machine=i386-unknown
  465.         os=-go32
  466.         ;;
  467.     i386-mingw32 | mingw32)
  468.         basic_machine=i386-unknown
  469.         os=-mingw32
  470.         ;;
  471.     iris | iris4d)
  472.         basic_machine=mips-sgi
  473.         case $os in
  474.             -irix*)
  475.             ;;
  476.             *)
  477.             os=-irix4
  478.             ;;
  479.         esac
  480.         ;;
  481.     isi68 | isi)
  482.         basic_machine=m68k-isi
  483.         os=-sysv
  484.         ;;
  485.     m88k-omron*)
  486.         basic_machine=m88k-omron
  487.         ;;
  488.     magnum | m3230)
  489.         basic_machine=mips-mips
  490.         os=-sysv
  491.         ;;
  492.     merlin)
  493.         basic_machine=ns32k-utek
  494.         os=-sysv
  495.         ;;
  496.     miniframe)
  497.         basic_machine=m68000-convergent
  498.         ;;
  499.     *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
  500.         basic_machine=m68k-atari
  501.         os=-mint
  502.         ;;
  503.     mipsel*-linux*)
  504.         basic_machine=mipsel-unknown
  505.         os=-linux-gnu
  506.         ;;
  507.     mips*-linux*)
  508.         basic_machine=mips-unknown
  509.         os=-linux-gnu
  510.         ;;
  511.     mips3*-*)
  512.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
  513.         ;;
  514.     mips3*)
  515.         basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
  516.         ;;
  517.     mmix*)
  518.         basic_machine=mmix-knuth
  519.         os=-mmixware
  520.         ;;
  521.     monitor)
  522.         basic_machine=m68k-rom68k
  523.         os=-coff
  524.         ;;
  525.     msdos)
  526.         basic_machine=i386-unknown
  527.         os=-msdos
  528.         ;;
  529.     mvs)
  530.         basic_machine=i370-ibm
  531.         os=-mvs
  532.         ;;
  533.     ncr3000)
  534.         basic_machine=i486-ncr
  535.         os=-sysv4
  536.         ;;
  537.     netbsd386)
  538.         basic_machine=i386-unknown
  539.         os=-netbsd
  540.         ;;
  541.     netwinder)
  542.         basic_machine=armv4l-rebel
  543.         os=-linux
  544.         ;;
  545.     news | news700 | news800 | news900)
  546.         basic_machine=m68k-sony
  547.         os=-newsos
  548.         ;;
  549.     news1000)
  550.         basic_machine=m68030-sony
  551.         os=-newsos
  552.         ;;
  553.     news-3600 | risc-news)
  554.         basic_machine=mips-sony
  555.         os=-newsos
  556.         ;;
  557.     necv70)
  558.         basic_machine=v70-nec
  559.         os=-sysv
  560.         ;;
  561.     next | m*-next )
  562.         basic_machine=m68k-next
  563.         case $os in
  564.             -nextstep* )
  565.             ;;
  566.             -ns2*)
  567.               os=-nextstep2
  568.             ;;
  569.             *)
  570.               os=-nextstep3
  571.             ;;
  572.         esac
  573.         ;;
  574.     nh3000)
  575.         basic_machine=m68k-harris
  576.         os=-cxux
  577.         ;;
  578.     nh[45]000)
  579.         basic_machine=m88k-harris
  580.         os=-cxux
  581.         ;;
  582.     nindy960)
  583.         basic_machine=i960-intel
  584.         os=-nindy
  585.         ;;
  586.     mon960)
  587.         basic_machine=i960-intel
  588.         os=-mon960
  589.         ;;
  590.     np1)
  591.         basic_machine=np1-gould
  592.         ;;
  593.     nsr-tandem)
  594.         basic_machine=nsr-tandem
  595.         ;;
  596.     op50n-* | op60c-*)
  597.         basic_machine=hppa1.1-oki
  598.         os=-proelf
  599.         ;;
  600.     OSE68000 | ose68000)
  601.         basic_machine=m68000-ericsson
  602.         os=-ose
  603.         ;;
  604.     os68k)
  605.         basic_machine=m68k-none
  606.         os=-os68k
  607.         ;;
  608.     pa-hitachi)
  609.         basic_machine=hppa1.1-hitachi
  610.         os=-hiuxwe2
  611.         ;;
  612.     paragon)
  613.         basic_machine=i860-intel
  614.         os=-osf
  615.         ;;
  616.     pbd)
  617.         basic_machine=sparc-tti
  618.         ;;
  619.     pbb)
  620.         basic_machine=m68k-tti
  621.         ;;
  622.         pc532 | pc532-*)
  623.         basic_machine=ns32k-pc532
  624.         ;;
  625.     pentium | p5 | k5 | k6 | nexen)
  626.         basic_machine=i586-pc
  627.         ;;
  628.     pentiumpro | p6 | 6x86)
  629.         basic_machine=i686-pc
  630.         ;;
  631.     pentiumii | pentium2)
  632.         basic_machine=i786-pc
  633.         ;;
  634.     pentium-* | p5-* | k5-* | k6-* | nexen-*)
  635.         basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
  636.         ;;
  637.     pentiumpro-* | p6-* | 6x86-*)
  638.         basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
  639.         ;;
  640.     pentiumii-* | pentium2-*)
  641.         basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
  642.         ;;
  643.     pn)
  644.         basic_machine=pn-gould
  645.         ;;
  646.     power)    basic_machine=rs6000-ibm
  647.         ;;
  648.     ppc)    basic_machine=powerpc-unknown
  649.             ;;
  650.     ppc-*)    basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
  651.         ;;
  652.     ppcle | powerpclittle | ppc-le | powerpc-little)
  653.         basic_machine=powerpcle-unknown
  654.             ;;
  655.     ppcle-* | powerpclittle-*)
  656.         basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
  657.         ;;
  658.     ps2)
  659.         basic_machine=i386-ibm
  660.         ;;
  661.     rom68k)
  662.         basic_machine=m68k-rom68k
  663.         os=-coff
  664.         ;;
  665.     rm[46]00)
  666.         basic_machine=mips-siemens
  667.         ;;
  668.     rtpc | rtpc-*)
  669.         basic_machine=romp-ibm
  670.         ;;
  671.     s390-*)
  672.         basic_machine=s390-ibm
  673.         os=-linux
  674.         ;;
  675.     sa29200)
  676.         basic_machine=a29k-amd
  677.         os=-udi
  678.         ;;
  679.     sequent)
  680.         basic_machine=i386-sequent
  681.         ;;
  682.     sh)
  683.         basic_machine=sh-hitachi
  684.         os=-hms
  685.         ;;
  686.     sparclite-wrs)
  687.         basic_machine=sparclite-wrs
  688.         os=-vxworks
  689.         ;;
  690.     sps7)
  691.         basic_machine=m68k-bull
  692.         os=-sysv2
  693.         ;;
  694.     spur)
  695.         basic_machine=spur-unknown
  696.         ;;
  697.     st2000)
  698.         basic_machine=m68k-tandem
  699.         ;;
  700.     stratus)
  701.         basic_machine=i860-stratus
  702.         os=-sysv4
  703.         ;;
  704.     sun2)
  705.         basic_machine=m68000-sun
  706.         ;;
  707.     sun2os3)
  708.         basic_machine=m68000-sun
  709.         os=-sunos3
  710.         ;;
  711.     sun2os4)
  712.         basic_machine=m68000-sun
  713.         os=-sunos4
  714.         ;;
  715.     sun3os3)
  716.         basic_machine=m68k-sun
  717.         os=-sunos3
  718.         ;;
  719.     sun3os4)
  720.         basic_machine=m68k-sun
  721.         os=-sunos4
  722.         ;;
  723.     sun4os3)
  724.         basic_machine=sparc-sun
  725.         os=-sunos3
  726.         ;;
  727.     sun4os4)
  728.         basic_machine=sparc-sun
  729.         os=-sunos4
  730.         ;;
  731.     sun4sol2)
  732.         basic_machine=sparc-sun
  733.         os=-solaris2
  734.         ;;
  735.     sun3 | sun3-*)
  736.         basic_machine=m68k-sun
  737.         ;;
  738.     sun4)
  739.         basic_machine=sparc-sun
  740.         ;;
  741.     sun386 | sun386i | roadrunner)
  742.         basic_machine=i386-sun
  743.         ;;
  744.     sv1)
  745.         basic_machine=sv1-cray
  746.         os=-unicos
  747.         ;;
  748.     symmetry)
  749.         basic_machine=i386-sequent
  750.         os=-dynix
  751.         ;;
  752.     t3e)
  753.         basic_machine=t3e-cray
  754.         os=-unicos
  755.         ;;
  756.     tx39)
  757.         basic_machine=mipstx39-unknown
  758.         ;;
  759.     tx39el)
  760.         basic_machine=mipstx39el-unknown
  761.         ;;
  762.     tower | tower-32)
  763.         basic_machine=m68k-ncr
  764.         ;;
  765.     udi29k)
  766.         basic_machine=a29k-amd
  767.         os=-udi
  768.         ;;
  769.     ultra3)
  770.         basic_machine=a29k-nyu
  771.         os=-sym1
  772.         ;;
  773.     v810 | necv810)
  774.         basic_machine=v810-nec
  775.         os=-none
  776.         ;;
  777.     vaxv)
  778.         basic_machine=vax-dec
  779.         os=-sysv
  780.         ;;
  781.     vms)
  782.         basic_machine=vax-dec
  783.         os=-vms
  784.         ;;
  785.     vpp*|vx|vx-*)
  786.                basic_machine=f301-fujitsu
  787.                ;;
  788.     vxworks960)
  789.         basic_machine=i960-wrs
  790.         os=-vxworks
  791.         ;;
  792.     vxworks68)
  793.         basic_machine=m68k-wrs
  794.         os=-vxworks
  795.         ;;
  796.     vxworks29k)
  797.         basic_machine=a29k-wrs
  798.         os=-vxworks
  799.         ;;
  800.     w65*)
  801.         basic_machine=w65-wdc
  802.         os=-none
  803.         ;;
  804.     w89k-*)
  805.         basic_machine=hppa1.1-winbond
  806.         os=-proelf
  807.         ;;
  808.     xmp)
  809.         basic_machine=xmp-cray
  810.         os=-unicos
  811.         ;;
  812.         xps | xps100)
  813.         basic_machine=xps100-honeywell
  814.         ;;
  815.     z8k-*-coff)
  816.         basic_machine=z8k-unknown
  817.         os=-sim
  818.         ;;
  819.     none)
  820.         basic_machine=none-none
  821.         os=-none
  822.         ;;
  823.  
  824. # Here we handle the default manufacturer of certain CPU types.  It is in
  825. # some cases the only manufacturer, in others, it is the most popular.
  826.     w89k)
  827.         basic_machine=hppa1.1-winbond
  828.         ;;
  829.     op50n)
  830.         basic_machine=hppa1.1-oki
  831.         ;;
  832.     op60c)
  833.         basic_machine=hppa1.1-oki
  834.         ;;
  835.     mips)
  836.         if [ x$os = x-linux-gnu ]; then
  837.             basic_machine=mips-unknown
  838.         else
  839.             basic_machine=mips-mips
  840.         fi
  841.         ;;
  842.     romp)
  843.         basic_machine=romp-ibm
  844.         ;;
  845.     rs6000)
  846.         basic_machine=rs6000-ibm
  847.         ;;
  848.     vax)
  849.         basic_machine=vax-dec
  850.         ;;
  851.     pdp11)
  852.         basic_machine=pdp11-dec
  853.         ;;
  854.     we32k)
  855.         basic_machine=we32k-att
  856.         ;;
  857.     sparc | sparcv9)
  858.         basic_machine=sparc-sun
  859.         ;;
  860.         cydra)
  861.         basic_machine=cydra-cydrome
  862.         ;;
  863.     orion)
  864.         basic_machine=orion-highlevel
  865.         ;;
  866.     orion105)
  867.         basic_machine=clipper-highlevel
  868.         ;;
  869.     mac | mpw | mac-mpw)
  870.         basic_machine=m68k-apple
  871.         ;;
  872.     pmac | pmac-mpw)
  873.         basic_machine=powerpc-apple
  874.         ;;
  875.     c4x*)
  876.         basic_machine=c4x-none
  877.         os=-coff
  878.         ;;
  879.     *)
  880.         echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  881.         exit 1
  882.         ;;
  883. esac
  884.  
  885. # Here we canonicalize certain aliases for manufacturers.
  886. case $basic_machine in
  887.     *-digital*)
  888.         basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
  889.         ;;
  890.     *-commodore*)
  891.         basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
  892.         ;;
  893.     *)
  894.         ;;
  895. esac
  896.  
  897. # Decode manufacturer-specific aliases for certain operating systems.
  898.  
  899. if [ x"$os" != x"" ]
  900. then
  901. case $os in
  902.         # First match some system type aliases
  903.         # that might get confused with valid system types.
  904.     # -solaris* is a basic system type, with this one exception.
  905.     -solaris1 | -solaris1.*)
  906.         os=`echo $os | sed -e 's|solaris1|sunos4|'`
  907.         ;;
  908.     -solaris)
  909.         os=-solaris2
  910.         ;;
  911.     -svr4*)
  912.         os=-sysv4
  913.         ;;
  914.     -unixware*)
  915.         os=-sysv4.2uw
  916.         ;;
  917.     -gnu/linux*)
  918.         os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
  919.         ;;
  920.     # First accept the basic system types.
  921.     # The portable systems comes first.
  922.     # Each alternative MUST END IN A *, to match a version number.
  923.     # -sysv* is not here because it comes later, after sysvr4.
  924.     -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
  925.           | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
  926.           | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
  927.           | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
  928.           | -aos* \
  929.           | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
  930.           | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
  931.           | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
  932.           | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
  933.           | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
  934.           | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
  935.           | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
  936.           | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
  937.           | -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*)
  938.     # Remember, each alternative MUST END IN *, to match a version number.
  939.         ;;
  940.     -qnx*)
  941.         case $basic_machine in
  942.             x86-* | i[34567]86-*)
  943.             ;;
  944.             *)
  945.             os=-nto$os
  946.             ;;
  947.         esac
  948.         ;;
  949.     -nto*)
  950.         os=-nto-qnx
  951.         ;;
  952.     -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
  953.           | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
  954.           | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
  955.         ;;
  956.     -mac*)
  957.         os=`echo $os | sed -e 's|mac|macos|'`
  958.         ;;
  959.     -linux*)
  960.         # To whom it may concern:
  961.         # - The name of Linux is Linux.
  962.         # - The kernel of the GNU system is the Hurd. This is stated
  963.         #   in the documentation of the GNU C preprocessor, section
  964.         #   "Assertions". Hence Linux is not a GNU system.
  965.         #os=`echo $os | sed -e 's|linux|linux-gnu|'`
  966.         ;;
  967.     -sunos5*)
  968.         os=`echo $os | sed -e 's|sunos5|solaris2|'`
  969.         ;;
  970.     -sunos6*)
  971.         os=`echo $os | sed -e 's|sunos6|solaris3|'`
  972.         ;;
  973.     -opened*)
  974.         os=-openedition
  975.         ;;
  976.     -wince*)
  977.         os=-wince
  978.         ;;
  979.     -osfrose*)
  980.         os=-osfrose
  981.         ;;
  982.     -osf*)
  983.         os=-osf
  984.         ;;
  985.     -utek*)
  986.         os=-bsd
  987.         ;;
  988.     -dynix*)
  989.         os=-bsd
  990.         ;;
  991.     -acis*)
  992.         os=-aos
  993.         ;;
  994.     -386bsd)
  995.         os=-bsd
  996.         ;;
  997.     -ctix* | -uts*)
  998.         os=-sysv
  999.         ;;
  1000.     -ns2 )
  1001.             os=-nextstep2
  1002.         ;;
  1003.     -nsk)
  1004.         os=-nsk
  1005.         ;;
  1006.     # Preserve the version number of sinix5.
  1007.     -sinix5.*)
  1008.         os=`echo $os | sed -e 's|sinix|sysv|'`
  1009.         ;;
  1010.     -sinix*)
  1011.         os=-sysv4
  1012.         ;;
  1013.     -triton*)
  1014.         os=-sysv3
  1015.         ;;
  1016.     -oss*)
  1017.         os=-sysv3
  1018.         ;;
  1019.     -svr4)
  1020.         os=-sysv4
  1021.         ;;
  1022.     -svr3)
  1023.         os=-sysv3
  1024.         ;;
  1025.     -sysvr4)
  1026.         os=-sysv4
  1027.         ;;
  1028.     # This must come after -sysvr4.
  1029.     -sysv*)
  1030.         ;;
  1031.     -ose*)
  1032.         os=-ose
  1033.         ;;
  1034.     -es1800*)
  1035.         os=-ose
  1036.         ;;
  1037.     -xenix)
  1038.         os=-xenix
  1039.         ;;
  1040.         -*mint | -*MiNT)
  1041.             os=-mint
  1042.         ;;
  1043.     -none)
  1044.         ;;
  1045.     *)
  1046.         # Get rid of the `-' at the beginning of $os.
  1047.         os=`echo $os | sed 's/[^-]*-//'`
  1048.         echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
  1049.         exit 1
  1050.         ;;
  1051. esac
  1052. else
  1053.  
  1054. # Here we handle the default operating systems that come with various machines.
  1055. # The value should be what the vendor currently ships out the door with their
  1056. # machine or put another way, the most popular os provided with the machine.
  1057.  
  1058. # Note that if you're going to try to match "-MANUFACTURER" here (say,
  1059. # "-sun"), then you have to tell the case statement up towards the top
  1060. # that MANUFACTURER isn't an operating system.  Otherwise, code above
  1061. # will signal an error saying that MANUFACTURER isn't an operating
  1062. # system, and we'll never get to this point.
  1063.  
  1064. case $basic_machine in
  1065.     *-acorn)
  1066.         os=-riscix1.2
  1067.         ;;
  1068.     arm*-rebel)
  1069.         os=-linux
  1070.         ;;
  1071.     arm*-semi)
  1072.         os=-aout
  1073.         ;;
  1074.         pdp11-*)
  1075.         os=-none
  1076.         ;;
  1077.     *-dec | vax-*)
  1078.         os=-ultrix4.2
  1079.         ;;
  1080.     m68*-apollo)
  1081.         os=-domain
  1082.         ;;
  1083.     i386-sun)
  1084.         os=-sunos4.0.2
  1085.         ;;
  1086.     m68000-sun)
  1087.         os=-sunos3
  1088.         # This also exists in the configure program, but was not the
  1089.         # default.
  1090.         # os=-sunos4
  1091.         ;;
  1092.     m68*-cisco)
  1093.         os=-aout
  1094.         ;;
  1095.     mips*-cisco)
  1096.         os=-elf
  1097.         ;;
  1098.     mips*-*)
  1099.         os=-elf
  1100.         ;;
  1101.     *-tti)    # must be before sparc entry or we get the wrong os.
  1102.         os=-sysv3
  1103.         ;;
  1104.     sparc-* | *-sun)
  1105.         os=-sunos4.1.1
  1106.         ;;
  1107.     *-be)
  1108.         os=-beos
  1109.         ;;
  1110.     *-ibm)
  1111.         os=-aix
  1112.         ;;
  1113.     *-wec)
  1114.         os=-proelf
  1115.         ;;
  1116.     *-winbond)
  1117.         os=-proelf
  1118.         ;;
  1119.     *-oki)
  1120.         os=-proelf
  1121.         ;;
  1122.     *-hp)
  1123.         os=-hpux
  1124.         ;;
  1125.     *-hitachi)
  1126.         os=-hiux
  1127.         ;;
  1128.     i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
  1129.         os=-sysv
  1130.         ;;
  1131.     *-cbm)
  1132.         os=-amigaos
  1133.         ;;
  1134.     *-dg)
  1135.         os=-dgux
  1136.         ;;
  1137.     *-dolphin)
  1138.         os=-sysv3
  1139.         ;;
  1140.     m68k-ccur)
  1141.         os=-rtu
  1142.         ;;
  1143.     m88k-omron*)
  1144.         os=-luna
  1145.         ;;
  1146.     *-next )
  1147.         os=-nextstep
  1148.         ;;
  1149.     *-sequent)
  1150.         os=-ptx
  1151.         ;;
  1152.     *-crds)
  1153.         os=-unos
  1154.         ;;
  1155.     *-ns)
  1156.         os=-genix
  1157.         ;;
  1158.     i370-*)
  1159.         os=-mvs
  1160.         ;;
  1161.     *-next)
  1162.         os=-nextstep3
  1163.         ;;
  1164.         *-gould)
  1165.         os=-sysv
  1166.         ;;
  1167.         *-highlevel)
  1168.         os=-bsd
  1169.         ;;
  1170.     *-encore)
  1171.         os=-bsd
  1172.         ;;
  1173.         *-sgi)
  1174.         os=-irix
  1175.         ;;
  1176.         *-siemens)
  1177.         os=-sysv4
  1178.         ;;
  1179.     *-masscomp)
  1180.         os=-rtu
  1181.         ;;
  1182.     f301-fujitsu)
  1183.         os=-uxpv
  1184.         ;;
  1185.     *-rom68k)
  1186.         os=-coff
  1187.         ;;
  1188.     *-*bug)
  1189.         os=-coff
  1190.         ;;
  1191.     *-apple)
  1192.         os=-macos
  1193.         ;;
  1194.     *-atari*)
  1195.         os=-mint
  1196.         ;;
  1197.     *)
  1198.         os=-none
  1199.         ;;
  1200. esac
  1201. fi
  1202.  
  1203. # Here we handle the case where we know the os, and the CPU type, but not the
  1204. # manufacturer.  We pick the logical manufacturer.
  1205. vendor=unknown
  1206. case $basic_machine in
  1207.     *-unknown)
  1208.         case $os in
  1209.             -riscix*)
  1210.                 vendor=acorn
  1211.                 ;;
  1212.             -sunos*)
  1213.                 vendor=sun
  1214.                 ;;
  1215.             -aix*)
  1216.                 vendor=ibm
  1217.                 ;;
  1218.             -beos*)
  1219.                 vendor=be
  1220.                 ;;
  1221.             -hpux*)
  1222.                 vendor=hp
  1223.                 ;;
  1224.             -mpeix*)
  1225.                 vendor=hp
  1226.                 ;;
  1227.             -hiux*)
  1228.                 vendor=hitachi
  1229.                 ;;
  1230.             -unos*)
  1231.                 vendor=crds
  1232.                 ;;
  1233.             -dgux*)
  1234.                 vendor=dg
  1235.                 ;;
  1236.             -luna*)
  1237.                 vendor=omron
  1238.                 ;;
  1239.             -genix*)
  1240.                 vendor=ns
  1241.                 ;;
  1242.             -mvs* | -opened*)
  1243.                 vendor=ibm
  1244.                 ;;
  1245.             -ptx*)
  1246.                 vendor=sequent
  1247.                 ;;
  1248.             -vxsim* | -vxworks*)
  1249.                 vendor=wrs
  1250.                 ;;
  1251.             -aux*)
  1252.                 vendor=apple
  1253.                 ;;
  1254.             -hms*)
  1255.                 vendor=hitachi
  1256.                 ;;
  1257.             -mpw* | -macos*)
  1258.                 vendor=apple
  1259.                 ;;
  1260.             -*mint | -*MiNT)
  1261.                 vendor=atari
  1262.                 ;;
  1263.         esac
  1264.         basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
  1265.         ;;
  1266. esac
  1267.  
  1268. echo $basic_machine$os
  1269.